function submitEditForm(stepVal,typeVal)
{
	document.ConfigForm.step.value=stepVal;
	document.ConfigForm.type.value=typeVal;
	document.ConfigForm.submit();    	
}
function submitForm(btName)
{
	document.ConfigForm.step.value=btName;
	document.ConfigForm.submit();
}
function submitNewForm(stepVal,typeVal)
{
	document.ConfigForm.step.value=stepVal;
	document.ConfigForm.type.value=typeVal;
	
	document.ConfigForm.displayName.value=document.dummyForm.displayName.value;
	document.ConfigForm.displayMsg.value=document.dummyForm.displayMsg.value;
	for (i=0;i<document.dummyForm.verificationType.length;i++){
		if (document.dummyForm.verificationType[i].checked==true){
			for(j=0;j<document.ConfigForm.verificationType.length;j++){
				if(document.ConfigForm.verificationType[j].value==document.dummyForm.verificationType[i]){
					document.ConfigForm.verificationType[j].checked=true;
					break;
				}
			}
			break;
		}
	}
	document.ConfigForm.emailAddresses.value=document.dummyForm.emailAddresses.value;
	document.ConfigForm.verificationEmailSub.value=document.dummyForm.verificationEmailSub.value;
	document.ConfigForm.verificationEmailMsg.value=document.dummyForm.verificationEmailMsg.value;
	document.ConfigForm.notificationEmailSub.value=document.dummyForm.notificationEmailSub.value;
	document.ConfigForm.notificationEmailMsg.value=document.dummyForm.notificationEmailMsg.value;
	document.ConfigForm.tags.value=document.dummyForm.tags.value;
	document.ConfigForm.submit();    	
}
function checkLength(name)
{
	var textBox = document.getElementsByName(name)[0].value;
	if (textBox.length>255)
	{
		document.getElementsByName(name)[0].value = textBox.substring(0,255);
	}
}
function showHideDiv(showRow,hideRow)
{
	var showVal;
	var hideVal;
	if(navigator.appName=="Microsoft Internet Explorer"){
		showVal="block";
	}else{
		showVal="table-row";
	}
	document.getElementById(showRow).style.display=showVal;
	document.getElementById(hideRow).style.display="none";
}


function toggleItem(showRow,hideRow,showImg,hideImg,openImage,closeImage)
{
	showRowId = document.getElementById(showRow);
	showImgId = document.getElementById(showImg);
	hideRowId = document.getElementById(hideRow);
	hideImgId = document.getElementById(hideImg);
	
	if(navigator.userAgent.indexOf('Firefox') != -1)
		blockType = "table-row";
	else
		blockType = "block";

	if(showRowId.style.display == blockType) 
	{
		showRowId.style.display = "none";
		showImgId.src = openImage;				
	}
	else
	{
		showRowId.style.display = blockType ;
		showImgId.src = closeImage;
	}
	
	if(hideRowId)	hideRowId.style.display = "none" ;
	if(hideImgId)	hideImgId.src = openImage;
}
function preview(type)
{	
	switch(type)
	{
		case "1":
			for (i=0;i<document.ConfigForm.sameAsSynonyms.length;i++){
				if (document.ConfigForm.sameAsSynonyms[i].checked==true){
					document.PreviewForm.sameAsSynonyms.value=document.ConfigForm.verificationType[i].value;
					document.PreviewForm.submit();	
				}
			}
			break;
		case "2":
			document.PreviewForm.displayName.value=document.ConfigForm.displayName.value;
			document.PreviewForm.displayMsg.value=document.ConfigForm.displayMsg.value;
			document.PreviewForm.tags.value=document.ConfigForm.tags.value;
			for (i=0;i<document.ConfigForm.verificationType.length;i++){
				if (document.ConfigForm.verificationType[i].checked==true){
					document.PreviewForm.verificationType.value=document.ConfigForm.verificationType[i].value;
					break;
				}
			}
			document.PreviewForm.synonym.value=document.ConfigForm.synonym.value;  
			document.PreviewForm.submit();  		
			break;
		case "3":
			document.PreviewForm.displayName.value=document.dummyForm.displayName.value;
			document.PreviewForm.displayMsg.value=document.dummyForm.displayMsg.value;
			document.PreviewForm.tags.value=document.dummyForm.tags.value;
			for (i=0;i<document.dummyForm.verificationType.length;i++){
				if (document.dummyForm.verificationType[i].checked==true){
					document.PreviewForm.verificationType.value=document.dummyForm.verificationType[i].value;
					break;
				}
			}
			document.PreviewForm.synonym.value=document.ConfigForm.synonym.value;  
			document.PreviewForm.submit();  
			break;
		default:
			break;
	}
}
